import React from "react";
import icon from "@/assets/images/user/choice_me.png";

interface IProp {
  data: OptionData;
  answers: string[];
  onChange: (value:string) => void;
}

export default function ChooseItem({ data, answers ,onChange}: IProp) {
  return (
    <div className="item flex" onClick={()=>onChange(data.key)}>
      <div className="radio">
        <img
          src={icon}
          alt=""
          style={{ display: answers.includes(data.key) ? "block" : "none" }}
        />
      </div>
      <div className="sort">{data.key}、</div>
      <div className="content">{data.value}</div>
    </div>
  );
}
